<{include file="header.htm"}>
<script src="<{$config.weburl}>/script/jquery-1.4.4.min.js" type="text/javascript"></script>
<script type="text/javascript" src="<{$config.weburl}>/script/jquery.validation.min.js"></script>
<header>
	<div class="nav-w">
    	<section class="nav-s"><a href="<{$config.weburl}>"><nav>首页</nav></a></section>
    	<section class="nav-c"><span>确认订单</span></section>
   		<section class="nav-e"></section>
    </div>
</header>
<link href="<{$config.weburl}>/templates/wap/css/product_order.css" rel="stylesheet" type="text/css" />
<section>
<{if $smarty.get.type=='login'}>
    <div class="w" style="margin:80px auto;">
        <a href="<{$config.weburl}>/login.php">请先登录</a>
    </div>
<{elseif  $smarty.get.type=='orders'}>
    <div class="w" style="margin:80px auto;">
        订单提交成功<br>
        <a href="<{$config.weburl}>/?m=product">继续购物</a>
        <a href="<{$config.weburl}>/main.php?m=product&s=admin_buyorder">进入后台</a>
    </div>
<{elseif $smarty.get.type=='orderf'}>
    <div class="w" style="margin:80px auto;">
    产品库存不足
    </div>
<{else}>
<{if $consignee.id&&$invoice.id}>
<div class="order">
	<h2>收货地址</h2>
 	<div class="item">
        <a href="main.php?m=member&s=admin_orderadder&t=pro">
            <p><{$consignee.name}></p>
            <p><{$consignee.area}></p>
            <p><{$consignee.address}></p>
            <p><{$consignee.mobile}></p>
     	 </a>
    </div>
	<h2>配送方式</h2>
    <div class="item ship">
    <{foreach item=list key=num from=$ship}>
    <p class="clearfix"><label><input <{if $num==0}>checked="checked"<{/if}> type="radio" name="ship" date_price="<{$list.price}>" date_pay="<{$list.pay}>" value="<{$list.id}>" /><{$list.title}> <b class="red"><{$config.money}><{$list.price|number_format:2}></b></label></p>
    <{/foreach}>
    </div>
	<h2>发票信息</h2>
 	<div class="item">
        <a href="main.php?m=member&s=admin_invoice&t=pro">
            <p>
            <{foreach item=v key=num from=$lang.itype}><{if $num==$invoice.type}><{$v}><{/if}><{/foreach}>
            <{foreach item=v key=num from=$lang.irise}><{if $num==$invoice.rise}><{$v}><{/if}><{/foreach}>
            <{foreach item=v key=num from=$lang.icontent}><{if $num==$invoice.content}><{$v}><{/if}><{/foreach}>
            </p>
     	 </a>
    </div>
  	<h2>商品清单</h2>
 	<div class="item">
        <{foreach item=list from=$cart.cart}>
        <{foreach item=pro from=$list.prolist}>
		<dl class="clearfix">
        <dt>
       		<img height="80" alt="<{$pro.name}>" src="<{$pro.pic}>_220X220.jpg">
        </dt>
        <dd>
            <p class="p-name"><{$pro.pname}></p>
			<p class="p-price">
            	<strong><{$config.money}><{$pro.price|number_format:2}></strong>
            </p>
            <{if $pro.product_give}>
            <{foreach item=list from=$pro.product_give}>
            <p class="p-detail">[赠品] <{$list.pname}></p>
            <{/foreach}>
            <{/if}>
            <{if $pro.service}>
            <{foreach item=list from=$pro.service}>
            <p class="p-detail">[服务] <{$list.name}>&nbsp;&nbsp;<b class="red"><{$config.money}><{$list.price}></b></p>
            <{/foreach}>
            <{/if}>
        </dd>
        </dl>
        <{/foreach}>
        <{/foreach}>
        <div class="order_summary">
            <div class="fl">
                <div>重量总计：<{$cart.weight}>kg</div>
            </div>
            <div class="statistic">
                <div class="list">
                    <span><em><{$cart.cart.0.prolist|@count}></em> 件产品，总产品金额：</span>
                    <span class="price"><{$config.money}><v id="price1"><{$cart.sumprice|number_format:2}></v></span>
                </div>
                <div class="list">
                    <span>运费：</span>
                    <span class="price"><{$config.money}><v id="price2"><{$ship.0.price|number_format:2}></b></span>
                </div>
            </div>
        </div>
    </div>
    <div class="clearfix">
        <span class="p-price total">
            应付总额：<strong><{$config.money}><span id="price3"></span></strong>
        </span>
    </div>
    <div class="choose_btn">
    <form action="" method="post">
        <input type="hidden" name="act" value="order" />
        <input type="submit" value="提交订单" class="cart-button">
        <input type="hidden" name="h_emsumprice" id="h_emsumprice"  value=""/>
        <input type="hidden" name="h_sumprice" id="h_sumprice" value="<{$cart.sumprice}>"/>
        <input type="hidden" id="weight" value="<{$cart.weight}>"/>
        <input type="hidden" id="city" value="<{$consignee.cityid}>"/>
        
        <input type="hidden" name="hidden_invoice_id" id="hidden_invoice_id" value="<{$invoice.id}>"/>
        <input type="hidden" name="hidden_consignee_id" id="hidden_consignee_id" value="<{$consignee.id}>" />
        <input type="hidden" name="hidden_payment_id" id="hidden_payment_id" value="<{$ship.0.pay}>" />
        <input type="hidden" name="hidden_ship_id" id="hidden_ship_id" value="<{$ship.0.id}>" />
    </form>
	</div>       
</div>
<script type="text/javascript">
count();
$(".ship input").bind("click",function(){
	$("#hidden_ship_id").val($(this).val());	
	$("#hidden_payment_id").val($(this).attr('date_pay'));	
	var price=$(this).attr('date_price');
	price=Number(price).toFixed(2);
	$("#price2").html(price);							 
	count();
});
function count(){
	price1=$("#price1").html().replace(",",'')*1;
	price2=$("#price2").html().replace(",",'')*1;
	price3=(price1+price2).toFixed(2);
	$("#price3").html(price3);
}
</script>
<{elseif !$invoice.id}>
<div class="noaddr">
<div></div>
您还没有设置发票<br><a href="main.php?m=member&s=admin_invoice&t=pro">请点击这里设置！</a> 
</div>
<{else}>
<div class="noaddr">
<div></div>
您还没有设置收货地址<br><a href="main.php?m=member&s=admin_orderadder&t=pro">请点击这里设置！</a> 
</div>
<{/if}>
</section>
<{/if}>
<{include file="footer.htm"}>